#!/bin/bash

if [ -O /etc/passwd ];then
	echo "you are the owner of /etc/passwd"
else
	echo "你不是这个文件的拥有者！"
fi

if [ -d /etc ] && [ -f /etc/passwd ];then
	echo "you get it"
fi

var1=12
if (( $var1 > 10 ));then
	echo " $var1 is greater than 10  "
fi

if [[ $USER == p* ]];then
	echo "you are $USER"
fi

case $USER in
tom | tony)
	echo "hello tom";;
penghk)
	echo "hello penghk";;
*)
	echo "default command"
esac

for var in a b c d
do
	echo "the num is $var"
done

for var in 我 是 好人
do 
	echo "word : $var"
done

list="a b c d"
list=$list" e"
for var in $list
do
	echo "word : $var"
done

#file="learnLinux.sh"
#for var in $(cat $file)
#do
#	echo $var
#done

for file in /home/penghk/*
do
	if [ -d $file ];then
		echo " $file is a dir "
	elif [ -f $file ];then
		echo "$file is a file "
	fi
done










